﻿using System;
using System.Runtime.Serialization;

namespace RIABlog.Web.Models
{
	/// <summary>
	/// Базовый класс для команд
	/// </summary>
	[KnownType(typeof(AgreeCommand))]
	[KnownType(typeof(DisagreeCommand))]
    [KnownType(typeof(ModerateCommand))]
    public abstract class BaseCommand : BaseEntity
	{
		/// <summary>
		/// Текст подсказки
		/// </summary>
		public abstract string Hint { get; }

		/// <summary>
		/// Ссылка на картинку
		/// </summary>
		public abstract string RelativeImageUrl { get; }

		/// <summary>
		/// Порядок расположения
		/// </summary>
		public abstract int OrderPos { get; }

		protected BaseCommand()
		{
			this.Id = Guid.NewGuid();
		}

		/// <summary>
		/// Выполняет команду
		/// </summary>
		/// <param name="entityId"></param>
		/// <returns></returns>
		internal abstract string Execute(Guid entityId);
	}
}